package com.tiaf;

import redis.clients.jedis.HostAndPort;
import redis.clients.jedis.Jedis;
import redis.clients.jedis.JedisCluster;
import redis.clients.jedis.JedisPoolConfig;

import java.util.HashSet;
import java.util.Set;

public class Program {
    public static void main(String[] args) {
        JedisPoolConfig config = new JedisPoolConfig();
        Set<HostAndPort> jedisClusterNode = new HashSet<HostAndPort>();
        //仅测试向扩容节点添加值
        jedisClusterNode.add(new HostAndPort("linux123", 7008));
        JedisCluster jcd = new JedisCluster(jedisClusterNode, config);

        String setValue="homework";
        jcd.set("name:001",setValue);
        String value = jcd.get("name:001");

        System.out.println("添加值:"+setValue);
        System.out.println("取出值:"+value);
    }
}
